import { BasicColumn, BasicTable, FormSchema, useTable } from "@/components/Table";
import Toolbar from "@/components/ViewComponents/Toolbar";
import { useTranslation } from "react-i18next";

const index = () => {
	const { t } = useTranslation();
	const en_vi = "Hospitalization.listOfSurgicalProcedures";
	const columns: BasicColumn[] = [
		{
			title: t(`${en_vi}.department`),
			dataIndex: "Fingerprint"
		}
	];
	const schemas: FormSchema[] = [
		{
			label: t(`${en_vi}.from`),
			field: "AdmissionTime", // 开始日期
			component: "DatePicker"
		},
		{
			label: t(`${en_vi}.to`),
			field: "Department", //结束日期
			component: "DatePicker"
		},
		{
			label: t(`${en_vi}.type`),
			field: "Profile", //类型
			component: "Input"
		},
		{
			label: t(`${en_vi}.status`),
			field: "Profile", //状态
			component: "Select"
		},
		{
			label: t(`${en_vi}.facility`),
			field: "Profile", //病房
			component: "Input"
		}
	];
	const [register] = useTable({
		columns,
		useSearchForm: true,
		formConfig: {
			labelWidth: 150,
			schemas,
			showActionButtonGroup: true,
			baseColProps: { span: 7 },
			actionColOptions: { span: 24 }
		},
		rowSelection: {
			type: "Checkbox",
			onChange: (techId: any) => {
				console.log(techId);
			}
		},
		bordered: true
	});
	const handlerToolbarAction = (key: string) => {
		console.log(key);
	};
	return (
		<div className="page">
			<div className=" page-content">
				<BasicTable register={register}></BasicTable>
			</div>
			<Toolbar action={handlerToolbarAction} btnList={["save"]} />
		</div>
	);
};
export default index;
